types(runtime-core): Allow InjectionKey to be used as a valid PropertyKey#5089
types(runtime-core): Allow InjectionKey to be used as a valid PropertyKey#5089pikax wants to merge 6 commits intovuejs:minorfrom
Conversation
|
This would technically be a (type) breaking change though, it would break existing apps using This probably needs to be put in a minor release (where we by convention may ship type breaking changes) |
Yes |
|
Just want to point out that this problem also (as of my knowledge) is at hand when using the function Edit: For my tests I can use |
# Conflicts: # packages/runtime-core/src/apiInject.ts # test-dts/inject.test-d.ts
Size ReportBundles
Usages
|
|
/ecosystem-ci run |
|
📝 Ran ecosystem CI: Open
|
|
Looks like the constraint of not being able to use |
This allows the InjectionKey to be used as a PropertyKey, useful for the OptionsAPI.
This also affects VTU, since the user needs to provide it's own overrides if needed:
There's a small issue that this change brings, with this change a
Symbolcannot be inferred as anInjectionKeyThis should lay down some work to support typed injections on the
defineComponentwhen using Options APIRef: microsoft/TypeScript#46956
Providing validation on
provideondefineComponentis harder than expected because when do akeyofit will convertInjectionKeytype into asymbollosing the types.Here's typescript example
playground